<template>
	<ul class="src-easy-form">
		<li><input type="checkbox" :checked="value('class','edr_abs')" @change="input('class','edr_abs',$event.target.checked)"></li>
		<li v-for="prop in props" :key="prop.key">
			<input type="text" :value="value('props',prop.key)" @input="input('props',prop.key,$event.target.value)">
		</li>
	</ul>
</template>
<script>
import utils from './utils.js';

export default {
	name: "EasyForm",
	props: ['props', 'data'],
	data() {
		return {

		}
	},
	computed: {

	},
	methods: {
		value(key, k) {
			let v = this.data
			if (!v) return v
			v = v[key]
			if (!v) return v
			return v[k]
		},
		input(key, k, v) {
			if (!this.data[key]) this.$set(this.data, key, { [k]: v })
			else this.$set(this.data[key], k, v)
			console.log(key, k, v)
		}
	},
	components: {

	}
}
</script>
<style lang="less">
.src-easy-form {
}
</style>
